class PagesController < ApplicationController

  layout :page_layout

  def show
    @article = Article.where(slug: params[:slug]).limit(1)[0]
    raise ActiveRecord::RecordNotFound if @article.blank?
    drop_title @article.title
  end

  def not_found

  end

  def server_error

  end

  private
  def page_layout
    if action_name == 'show'
      'application'
    else
      'blank'
    end
  end
end
